<template>
  <el-row>
    <basic-container>
      <el-form ref="formSensor" :model="formSensor" label-width="100px">
        <el-card shadow="hover">
          <div slot="header">
            <span>传感器信息</span>
          </div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="测点位置">
                <el-input :disabled="true" v-model="formPosition.local" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="测点类型">
                <el-input :disabled="true" v-model="formPosition.positionTypeName" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="设备名称">
                <el-input :disabled="true" v-model="formPosition.deviceName" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="测点状态">
                <el-input :disabled="true" v-model="formPosition.positionStatusName" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="上限预警类型">
                <el-input :disabled="true" v-model="formPosition.alarmHighTypeName" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下限预警类型">
                <el-input :disabled="true" v-model="formPosition.alarmLowTypeName" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="上限预警值">
                <el-input :disabled="true" v-model="formPosition.alarmHighValue" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="下限预警值">
                <el-input :disabled="true" v-model="formPosition.alarmLowValue" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>
    </basic-container>
  </el-row>
</template>

<script>
  import {getPositionDetail} from "@/api/stress/position";

  export default {
    data() {
      return {
        //传感器
        formPosition:{
          local:'',
          positionTypeName:'',
          deviceName:'',
          positionStatusName:'',
          alarmHighTypeName:'',
          alarmLowTypeName:'',
          alarmHighValue:'',
          alarmLowValue:''
        },
      };
    },
    created() {
      this.initData();
    },
    computed: {

      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
    },
    mounted() {
    },
    methods: {
      initData() {
        const id = this.$route.params.id;
        this.handleSensorDetail(id);
      },
      handleSensorDetail(id){
        getPositionDetail(id).then(res => {
          this.formPosition = res.data.data;
        })
      },
    }
  };
</script>

<style>
  .box {
    height: 800px;
  }

  .el-scrollbar {
    height: 100%;
  }

  .box .el-scrollbar__wrap {
    overflow: scroll;
  }
</style>
